//
//  IssueCell.swift
//  GitOSC-Swift
//
//  Created by 李萍 on 16/3/10.
//  Copyright © 2016年 李萍. All rights reserved.
//

import UIKit
import Kingfisher

class IssueCell: UITableViewCell {
    @IBOutlet weak var userPortrait: UIImageView!
    @IBOutlet weak var issueTitle: UILabel!
    
    @IBOutlet weak var timeLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func setContentForIssue(issue: GTIssue) {
        let url:NSURL = NSURL(string: "https://git.oschina.net/"+(issue.author?.portrait)!)!
        self.userPortrait.kf_setImageWithURL(url, placeholderImage:UIImage.init(named: "portrait_loading"))
        self.issueTitle.text = issue.title
        self.timeLabel.text = issue.setUserNameAndTime()
    }
}
